import request from '@/utils/request'

// 查询订单列表
export function listClientorder(query) {
  return request({
    url: '/clientorder/clientorder/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getClientorder(id) {
  return request({
    url: '/clientorder/clientorder/' + id,
    method: 'get'
  })
}

// 新增订单
export function addClientorder(data) {
  return request({
    url: '/clientorder/clientorder',
    method: 'post',
    data: data
  })
}

export function addOrder(OrderItemRequest) {
  return request({
    url: '/clientorder/clientorder/new',
    method: 'post',
    data: OrderItemRequest
  })
}

// 修改订单
export function updateClientorder(data) {
  return request({
    url: '/clientorder/clientorder',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delClientorder(id) {
  return request({
    url: '/clientorder/clientorder/' + id,
    method: 'delete'
  })
}

// 查询订单项信息列表
export function listItem(orderSn) {
  return request({
    url: '/clientorder/item/list/'+orderSn,
    method: 'get',
  })
}